#include<bits/stdc++.h>

using namespace std;
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &e:a)cin >> e;
    a.erase(unique(a.begin(), a.end()), a.end());
    for (auto e:a) {
        cout << e << " ";
    }
    return 0;
}